package view;

import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.paint.Color;
import javafx.stage.StageStyle;

import java.io.IOException;

public class ResetView extends Window{

    public ResetView() throws IOException {
        root = FXMLLoader.load(getClass().getClassLoader().getResource("reset.fxml"));
        Scene scene = new Scene(root, 600, 400);
        scene.setFill(Color.TRANSPARENT);
        setScene(scene);
        initStyle(StageStyle.TRANSPARENT);
        setResizable(false);
        setTitle("LightQ");
        move();
        quit();
        minimize();
    }

    @Override
    public void quit() {
        ((Button)findViewById("quit")).setOnAction(event -> {
            close();
            try {
                new LoginView().show();
            } catch (IOException e) {
                e.printStackTrace();
            }
        });
    }

    @Override
    public void minimize() {
        ((Button)findViewById("min")).setOnAction(event -> {
            setIconified(true);
        });
    }
}
